package main;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.net.URL;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

@SuppressWarnings({ "serial", "unused" })
public class Splash extends JPanel implements MouseListener 
{
	ImageIcon image;
	Main main;
	public Splash(Main m)
	{
		try
		{
			image = new ImageIcon("SnakeTitle.png");
			//image = new ImageIcon(new URL("http://zmtn.dyndns-web.com/SnakeTitle.png"));
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		main = m;
		addMouseListener(this);
		repaint();
	}
	public void paintComponent(Graphics g)
	{
		image.paintIcon(this, g, 0, 0);
	}
	public void mouseClicked(MouseEvent arg0) {}

	public void mouseEntered(MouseEvent arg0) {}

	public void mouseExited(MouseEvent arg0) {}
	
	public void mousePressed(MouseEvent arg0) {}

	public void mouseReleased(MouseEvent arg0) 
	{
		removeMouseListener(this);
		main.backToMainMenu();	
	}
}
